import { useSelector } from "react-redux";
import { Spin } from "antd";
import "./App.css";
import "./Views/Shared/shared.css";
import "./Views/Org/Css/Org.css";
import "./Views/Right/Css/Right.css";
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import routerConfig from "./AppConfig/routerConfig";
function App() {
  const loading = useSelector((state) => state.loading.value); // 获取状态
  return (
    <div className="fill">
      <Router>
        <Routes>
          {routerConfig.map((route, index) => (
            <Route key={index} path={route.path} element={route.element} />
          ))}
        </Routes>
      </Router>
      <Spin
        tip="Loading..."
        size="large"
        spinning={loading}
        fullscreen={true}
      ></Spin>
    </div>
  );
}

export default App;
